package com.qiwx.pigeon.widget.itemderection;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.RecyclerView;

/**
 * @description
 * @Author qiwx
 * @Date 2020-03-22 11:13
 **/
public class CustomGridItemDecoration extends RecyclerView.ItemDecoration {
    private int space;

    public CustomGridItemDecoration(int space) {
        this.space = space;

    }

    //获取item的偏移量，保存在outRect中
    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        outRect.set(0, 0, space, space);

    }
}
